<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改医院个性化配置')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-hospitalIndividuation-edit" th:object="${yfHospitalIndividuationData}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">医疗机构单位：</label>
            <div class="col-sm-8">
                <select name="hospitalId" id="hospitalId" class="form-control" th:with="v=${@dep.getCurrentDeptList()}"
                        required>
                    <option value="">------请选择医疗机构------</option>
                    <option th:each="l:${v}" th:text="${l.deptName}" th:value="${l.deptId}"
                            th:field="*{hospitalId}"></option>
                </select>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label is-required">字典类型：</label>
            <div class="col-sm-8">
                <input name="dictType" th:field="*{dictType}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">字典值：</label>
            <div class="col-sm-8">
                <input name="dictValue" th:field="*{dictValue}" class="form-control" type="text" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                    <input type="radio" th:id="${'status_' + dict.dictCode}" name="status"
                           th:value="${dict.dictValue}" th:field="*{status}"
                           th:checked="${dict.default}">
                    <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group" shiro:hasAnyRoles="admin">
            <label class="col-sm-3 control-label">删除状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('del_flag')}">
                    <input type="radio" th:id="${'delFlag_' + dict.dictCode}" name="delFlag" th:field="*{delFlag}"
                           th:value="${dict.dictValue}" th:checked="${dict.default}">
                    <label th:for="${'delFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" maxlength="400" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>

<script type="text/javascript">
    var prefix = ctx + "yf/hospitalIndividuation";
    $("#form-hospitalIndividuation-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-hospitalIndividuation-edit').serialize());
        }
    }
</script>
</body>
</html>